/*
 * @(#)MaintForumGroupDetailForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.forum.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.forum.ForumOperationConstant;
import com.dcivision.forum.bean.ForumGroupDetail;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;
/**
  MaintForumGroupDetailForm.java

  This class is the for web form purpose.

  @author      Zoe Shum
  @company     DCIVision Limited
  @creation date   15/10/2003
  @version     $Revision: 1.6 $
*/

public class MaintForumGroupDetailForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.6 $";

  private String forumGroupID = null;
  private String parentID = null;
  private String objectType = ForumOperationConstant.FOURM_OBJECT_TYPE_DOCUMENT;
  private String objectID = null;
  private String topic = null;
  private String detail = null;
  private String alwaysOnTop = null;
  private String reads = null;
  private String replyTotal = null;

  //For DMS module
  private String rootID = null;
  private String docParentID = null;
  private String curFunctionCode = null;

  public MaintForumGroupDetailForm() {
    super();
  }

  public String getForumGroupID() {
    return(this.forumGroupID);
  }

  public void setForumGroupID(String forumGroupID) {
    this.forumGroupID = forumGroupID;
  }

  public String getParentID() {
    return(this.parentID);
  }

  public void setParentID(String parentID) {
    this.parentID = parentID;
  }

  public String getObjectType() {
    return(this.objectType);
  }

  public void setObjectType(String objectType) {
    this.objectType = objectType;
  }

  public String getObjectID() {
    return(this.objectID);
  }

  public void setObjectID(String objectID) {
    this.objectID = objectID;
  }

  public String getTopic() {
    return(this.topic);
  }

  public void setTopic(String topic) {
    this.topic = topic;
  }

  public String getDetail() {
    return(this.detail);
  }

  public void setDetail(String detail) {
    this.detail = detail;
  }

  public String getAlwaysOnTop() {
    return(this.alwaysOnTop);
  }

  public void setAlwaysOnTop(String alwaysOnTop) {
    this.alwaysOnTop = alwaysOnTop;
  }

  public String getReads() {
    return(this.reads);
  }

  public void setReads(String reads) {
    this.reads = reads;
  }

  public String getReplyTotal(){
    return(this.replyTotal);
  }

  public void getReplyTotal(String replyTotal){
    this.replyTotal = replyTotal;
  }

  public String getRootID() {
    return(this.rootID);
  }

  public void setRootID(String rootID) {
    this.rootID = rootID;
  }

  public String getDocParentID() {
    return(this.docParentID);
  }

  public void setDocParentID(String docParentID) {
    this.docParentID = docParentID;
  }

  public void setCurFunctionCode(String curFunctionCode) {
    this.curFunctionCode = curFunctionCode;
  }

  public String getCurFunctionCode() {
    return curFunctionCode;
  }

  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setForumGroupID(null);
    this.setParentID(null);
    //this.setObjectType(null);
    this.setObjectID(null);
    this.setTopic(null);
    this.setDetail(null);
    this.setAlwaysOnTop(null);
    this.setReads(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    ForumGroupDetail tmpForumGroupDetail = new ForumGroupDetail();
    tmpForumGroupDetail.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpForumGroupDetail.setForumGroupID(TextUtility.parseIntegerObj(this.getForumGroupID()));
    tmpForumGroupDetail.setParentID(TextUtility.parseIntegerObj(this.getParentID()));
    tmpForumGroupDetail.setObjectType(this.getObjectType());
    tmpForumGroupDetail.setObjectID(TextUtility.parseIntegerObj(this.getObjectID()));
    tmpForumGroupDetail.setTopic(this.getTopic());
    tmpForumGroupDetail.setDetail(this.getDetail());
    tmpForumGroupDetail.setAlwaysOnTop(this.getAlwaysOnTop());
    tmpForumGroupDetail.setReads(TextUtility.parseIntegerObj(this.getReads()));
    tmpForumGroupDetail.setRecordStatus(this.getRecordStatus());
    tmpForumGroupDetail.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpForumGroupDetail.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpForumGroupDetail.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpForumGroupDetail.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpForumGroupDetail.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpForumGroupDetail;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    ForumGroupDetail tmpForumGroupDetail = (ForumGroupDetail)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpForumGroupDetail.getID()));
    this.setForumGroupID(TextUtility.formatIntegerObj(tmpForumGroupDetail.getForumGroupID()));
    this.setParentID(TextUtility.formatIntegerObj(tmpForumGroupDetail.getParentID()));
    this.setObjectType(tmpForumGroupDetail.getObjectType());
    this.setObjectID(TextUtility.formatIntegerObj(tmpForumGroupDetail.getObjectID()));
    this.setTopic(tmpForumGroupDetail.getTopic());
    this.setDetail(tmpForumGroupDetail.getDetail());
    this.setAlwaysOnTop(tmpForumGroupDetail.getAlwaysOnTop());
    this.setReads(TextUtility.formatIntegerObj(tmpForumGroupDetail.getReads()));
    this.setRecordStatus(tmpForumGroupDetail.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpForumGroupDetail.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpForumGroupDetail.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpForumGroupDetail.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpForumGroupDetail.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpForumGroupDetail.getUpdateDate()));
  }
}
